Skip to content

Conversation

otac0n
Copy link
Contributor

@otac0n otac0n commented Aug 29, 2025

Summary

Adds the STM32F411E-DISCO board.

Fixes #2808

I have the board and would like to use it along with SimpleFOC, an Arduino library.

Validation

I could use some advice on validating this, as I was using PlatformIO to work with my board previously.

@otac0n otac0n marked this pull request as draft August 30, 2025 00:08
@otac0n otac0n force-pushed the main branch 2 times, most recently from d2ae5f7 to 24fc105 Compare August 30, 2025 14:35
@otac0n
Copy link
Contributor Author

otac0n commented Aug 31, 2025

When I try to create a generic layout, the STM32CubeMX cannot find a clock solution for any configuration without an external input frequency. It basically says that PLL Source Mux should be HSE.

image

Should I enable HSE for the generic board or should I try to ignore the warning given that it reaches 48MHz for USB, etc.

@otac0n
Copy link
Contributor Author

otac0n commented Aug 31, 2025

I also do not know where to grab the pinout definitions for the specific board. The guide I am using does not specify how to add a specific board, it cuts off after adding the generic board.

@fpistm
Copy link
Member

fpistm commented Sep 1, 2025

Hi @otac0n

Should I enable HSE for the generic board or should I try to ignore the warning given that it reaches 48MHz for USB, etc.

No, generic have to use the internal clock only. If user wants to use HSE then he have to redefine the system core clock config at sketch level.
Dedicated variant can defined by default the HSE if they have one as the hardware is known.

I also do not know where to grab the pinout definitions for the specific board. The guide I am using does not specify how to add a specific board, it cuts off after adding the generic board.

Well in general at least the Arduino connector have top be properly defined D0-D15 and A0-A5 but this Disco has no Arduino connector so you can simply defined them following each connector.
For Example:

/* P1 connector right side */
#define PC1 0
#define PC3 2
...
/* P1 connector left side */
#define PC1 19

Or
For Example:

/* P1 connector */
#define PC1 0
#define PC3 1
...

You can refer to this one as example:
https://github.com/stm32duino/Arduino_Core_STM32/blob/main/variants/STM32F4xx/F407V(E-G)T_F417V(E-G)T/variant_DISCO_F407VG.cpp
https://github.com/stm32duino/Arduino_Core_STM32/blob/main/variants/STM32F4xx/F407V(E-G)T_F417V(E-G)T/variant_DISCO_F407VG.h

So you have to create the variant_DISCO_F411VE.*

@otac0n otac0n marked this pull request as ready for review September 2, 2025 04:24
@otac0n otac0n force-pushed the main branch 3 times, most recently from 32f041a to 5a50ba7 Compare September 3, 2025 23:40
@otac0n
Copy link
Contributor Author

otac0n commented Sep 3, 2025

So, I have

  • generated and copied the ldscript.ld
  • generated the clock code for Generic and for the DISCO_F411VE variant.
  • copied the variant_generic.c/h files to make variant_DISCO_F411VE.c/h
    • reordered and renumbered the pins in the same order as the DISCO_F407VG board
    • updated LED, BUTTON, SPI, and I2C sections.
    • defined HAL_DAC_MODULE_ENABLED

That puts it on par with the DISCO_F407VG. Let me know what steps can be taken to validate these files on hardware.

@fpistm
Copy link
Member

fpistm commented Sep 4, 2025

That puts it on par with the DISCO_F407VG. Let me know what steps can be taken to validate these files on hardware.

You can use this examples to check if the pin mapping is correct:
https://github.com/stm32duino/STM32Examples/tree/main/examples/NonReg/CheckVariant

@fpistm fpistm added the new variant Add support of new bard label Sep 8, 2025
@fpistm fpistm added this to the 2.11.1/2.12.0 milestone Sep 8, 2025
@otac0n
Copy link
Contributor Author

otac0n commented Sep 9, 2025

I had to order a USB Serial connector to test this out. Using the generic variant I get this:

#####
NUM_DIGITAL_PINS = 81
NUM_ANALOG_INPUTS = 16
#####
Checking digital pins...
End check digital pins
#####
Checking analog pins definition...
End check analog pins
#####
Checking IP instances (I2C, UART, SPI)...
End check IP instances (I2C, UART, SPI)

########################################
#### Test PASSED
########################################

Using my variant_DISCO_F411VE I get errors that I'm unsure where they originate:

<path>2.11.0\libraries\SrcWrapper\src\stm32\analog.cpp:340:17: error: 'DAC_CHANNEL_1' was not declared in this scope; did you mean 'ADC_CHANNEL_1'?
<path>2.11.0\libraries\SrcWrapper\src\stm32\analog.cpp:364:6: error: variable or field 'HAL_DAC_MspInit' declared void
...

Edit: Fixed that. Now it just locks up due to bad clock config?

I will say that I had trouble following step 1 here: https://github.com/stm32duino/Arduino_Core_STM32/wiki/Using-git-repository

@otac0n otac0n force-pushed the main branch 2 times, most recently from 0942d2a to d2412a1 Compare September 9, 2025 03:34
@otac0n
Copy link
Contributor Author

otac0n commented Sep 9, 2025

OK, with a change to RCC_HSE_ON (instead of RCC_HSE_BYPASS) my board passes the tests.

#####
NUM_DIGITAL_PINS = 81
NUM_ANALOG_INPUTS = 16
#####
Checking digital pins...
End check digital pins
#####
Checking analog pins definition...
End check analog pins
#####
Checking IP instances (I2C, UART, SPI)...
End check IP instances (I2C, UART, SPI)

########################################
#### Test PASSED
########################################

I believe this to be ready, but I would appreciate a critical look-over as this is my first Arduino board.

@fpistm
Copy link
Member

fpistm commented Sep 9, 2025

Yesterday, I've made a review and force push on your branch to fix all the issue you made 😉
But forgot to warn you.
To sum up: no DAC, HSE on instead of bypass.

@fpistm
Copy link
Member

fpistm commented Sep 9, 2025

Will end review this morning.

@fpistm
Copy link
Member

fpistm commented Sep 9, 2025

I had to order a USB Serial connector to test this out. Using the generic variant I get this:

You can simply connect the default Serial to the STLink. SB10 and SB11 not fitted on the board,if you add SB then you will have the VCP functional.

@fpistm fpistm closed this Sep 9, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in STM32 core based on ST HAL Sep 9, 2025
@fpistm fpistm reopened this Sep 9, 2025
@github-project-automation github-project-automation bot moved this from Done to In progress in STM32 core based on ST HAL Sep 9, 2025
@fpistm
Copy link
Member

fpistm commented Sep 9, 2025

I've pushed some updates on your branch.

@github-project-automation github-project-automation bot moved this from In progress to Reviewer approved in STM32 core based on ST HAL Sep 9, 2025
@fpistm fpistm merged commit 93d9973 into stm32duino:main Sep 9, 2025
24 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer approved to Done in STM32 core based on ST HAL Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new variant Add support of new bard
Projects
Development

Successfully merging this pull request may close these issues.

[New Variant] Please add board STM32F411E-DISCO
2 participants